<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>在线商城后台登陆</title>
<link rel="stylesheet" type="text/css" href="views/admin/style/css/basic.css" />
<link rel="stylesheet" type="text/css" href="views/admin/style/css/login.css" />
<script type="text/javascript" src="views/common/js/jquery-1.8.2.min.js"></script>
<link rel="stylesheet" type="text/css" href="views/common/js/msgbox/msgbox.css" />
<script type="text/javascript" src="views/common/js/msgbox/msgbox.js"></script>

<script type="text/javascript" src="views/common/js/artDialog4.1.6/jquery.artDialog.js?skin=blue"></script>
<script type="text/javascript" src="views/common/js/artDialog4.1.6/plugins/iframeTools.js"></script>
<script type="text/javascript">
$(document).ready(function(){
    $("#button").click(function(){
        if($("#user").val() == ''){
            art.dialog.alert('请输入管理员用户名');return false;
        }
        if($("#passwd").val() == ''){
            art.dialog.alert('请输入管理员密码');return false;
        }
        if($("#code").val() == ''){
            art.dialog.alert('请输入验证码');return false;
        } else {
            $.get("?c=admin&m=checkCode&code=" + $("#code").val(),
                function(msg){
                    if(msg == 'success'){
                        $.post("?c=admin&m=login", {user: $("#user").val(),passwd: $("#passwd").val(),code: $("#code").val()},
                            function(msg){
                                if(msg == 'success'){
                                    art.dialog.tips('成功登陆！', 1);
                                    setTimeout(function(){
                                        location.href='?c=admin';
                                    },1000);
                                } else if(msg == 'warning'){
                                    art.dialog.tips('请输入正确的管理员密码！', 1);
                                } else if(msg == 'error'){
                                    art.dialog.tips('此用户名不存在！', 1);
                            }
                        });
                    }else{
                        art.dialog.alert('验证码不正确');
                    }
                }
            );
        }
    })
})
</script>
</head>
<body>
<div id="login">
	<dl>
		<dd>管理员姓名：<input type="text" name="user" id="user" class="text" /></dd>
		<dd>管理员密码：<input type="password" id="passwd" name="passwd" class="text" /></dd>
		<dd>验　证　码：<input type="text" name="code" id="code" class="text" /></dd>
		<dd class="code"><img src="?c=index&m=validateCode" title="看不清？点击刷新" onclick="javascript:this.src='?a=index&m=validateCode&tm='+Math.random()" /></dd>
		<dd><button type="submit" class="submit" id="button" />进入管理中心</button></dd>
	</dl>
</div>
</body>
</html>